package com.yang.booking.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yang.booking.pojo.Item;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ItemMapper extends BaseMapper<Item> {

//    @Select("select * from mysql_data ${ew.customSqlSegment}")
//    QueryWrapper<Item> getAll(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("select count(i.id) from item i inner join staff_item si on i.id = si.item_id where si.staff_id = #{staffId}")
    int QueryStaffItemCount(String staffId);

}
